home *** CD-ROM | disk | FTP | other *** search
- /* makedata.rexx */
-
- /*
- * Written by Ben Williams
- * -----------------------
- * March 7th, 1994
- * for Black Belt Systems
- */
-
- /*
- * open rexxsupport.library -- needed for some functions
- */
- if ~show('L',"rexxsupport.library") then do
- if addlib('rexxsupport.library',0,-30,0) then do
- /* everything's ok */
- end;
- else do
- say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
- say 'Cannot operate makedata.rexx without this library - sorry!';
- exit 1;
- end;
- end;
-
- filename = "ram:imdatagen_aa.doc";
- tfilename = "ram:aa.tmp_tmp_tmp.aa"
-
- address command 'avail >'||tfilename
- if open(tmphandle,tfilename,read)=1 then do
- tdata = readln(tmphandle); /* title line */
- cdata = readln(tmphandle); /* chip line */
- fdata = readln(tmphandle); /* fast line */
- mdata = readln(tmphandle); /* max line */
- err = close(tmphandle);
- end
- else do
- say 'cannot open '||tfilename;
- exit 2
- end
-
- address command 'version >'||tfilename
- if open(tmphandle,tfilename,read)=1 then do
- vdata = readln(tmphandle);
- err = close(tmphandle);
- end
- else do
- say 'cannot open '||tfilename;
- exit 3
- end
-
- address command 'cpu >'||tfilename
- if open(tmphandle,tfilename,read)=1 then do
- xdata = readln(tmphandle);
- err = close(tmphandle);
- end
- else do
- say 'cannot open '||tfilename;
- exit 3
- end
-
- address command 'which >'||tfilename||' rx';
- if open(tmphandle,tfilename,read)=1 then do
- rxdata = readln(tmphandle);
- err = close(tmphandle);
- end
- else do
- say 'cannot open '||tfilename;
- exit 4
- end
-
- address command 'assign >'||tfilename
- haverexx = 0;
- if open(tmphandle,tfilename,read)=1 then do
- looping = 1
- do while looping = 1
- adata = readln(tmphandle);
- parse var adata key remainder
- if key = 'Directories:' then looping = 0;
- end
- looping = 1;
- do while looping = 1
- adata = readln(tmphandle);
- parse var adata key remainder
- if key = 'Devices:' then looping = 0;
- key = upper(key);
- if key = 'REXX' then do
- looping = 0;
- haverexx = 1;
- end
- end
- err = close(tmphandle);
- end
- else do
- say 'cannot open '||tfilename;
- exit 5
- end
-
- haveim = 0;
- plist = showlist('p');
- looping = 1;
- do while looping = 1
- parse var plist punga plist;
- if punga = 'IM_Port' then do
- haveim = 1;
- looping = 0;
- end
- if punga = '' then looping = 0;
- end;
-
- if haveim = 1 then do
- options results;
- address 'IM_Port' 'version';
- options;
- vx = result;
- parse var vx ver ',' rev;
- end
-
- if open(handle,filename,Write)=1 then do
- cnt = writeln(handle,'\ApAssist');
- cnt = writeln(handle,'\: Automatically generated ApAssist file');
- cnt = writeln(handle,'\node "amigadata"');
- cnt = writeln(handle,'\title "System Information');
- cnt = writeln(handle,'\next ""');
- cnt = writeln(handle,'\prev ""');
- cnt = writeln(handle,'\nw');
- cnt = writeln(handle,'');
- cnt = writeln(handle,'\{ \ts bu System Configuration on '||date()||' at '||time(normal)||'\}');
- cnt = writeln(handle,'');
- parse var cdata mtype mavail minuse mmax mlarge
- cnt = writeln(handle,'Chip Memory: '||mmax);
- parse var fdata mtype mavail minuse mmax mlarge
- cnt = writeln(handle,'Fast memory: '||mmax);
- cnt = writeln(handle,vdata);
- cnt = writeln(handle,xdata);
- if haverexx=1 then do
- parse var adata key ' ' aadata;
- aadata = strip(aadata);
- cnt = writeln(handle,'Rexx is assigned to \{ \tc DarkBlue '||aadata||'\}');
- end
- else do
- cnt = writeln(handle,'\{ \tc Red REXX: is \{ \ts ui not\} \= assigned!\}');
- cnt = writeln(handle,'\{\ts b Press Here to learn more about: \} \link " Assigning Rexx " "imdoc:re_hlp/re_pathrx"');
- end
- if haveim=1 then do
- cnt = writeln(handle,'Imagemaster R/t version \{ \tc DarkBlue '||ver||'.'||rev'\}');
- end
- else do
- cnt = writeln(handle,'\{ \tc Red Imagemaster R/t is not running - '||"can't"||' tell version! \}');
- end
- if rxdata="" then do
- cnt = writeln(handle,'\{ \tc Red Cannot locate RX command - No Path! \}');
- cnt = writeln(handle,'\{ \ts b Press Here to learn more about: \} \link " Locating RX " "imdoc:re_hlp/re_assignrx"');
- end
- else do
- cnt = writeln(handle,'Path to the RX command is \{ \tc DarkBlue '||rxdata||'\}');
- end
- cnt = writeln(handle,'\endnode');
- err = close(handle);
- end
- else do
- say "OUCH! Can't open output file!"
- exit 6
- end
-
- address command 'delete '||tfilename||' >nil:';
-